package com.yami.shop.cp.comment.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.app.dto.ShopCartDto;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.cp.comment.dto.CPProdInfo;
import com.yami.shop.cp.comment.dto.CollaborativePurchaseShopCartItemDto;
import com.yami.shop.cp.comment.model.CollaborativePurchaseBasket;
import com.yami.shop.cp.comment.param.ChangeSubmitPersonShopCartParam;

import java.util.List;

/**
 * <p>
 * 协同采购提报人购物车 服务类
 * </p>
 *
 * @author xch
 * @since 2021-06-29
 */
public interface CollaborativePurchaseBasketService extends IService<CollaborativePurchaseBasket> {

    /**
     * 获取提报人当前协同采购单的购物车商品
     *
     * @param mobile                  提报人手机号
     * @param collaborativePurchaseId 协同采购单id
     * @return List<ChangeSubmitPersonShopCartParam>
     */
    List<CollaborativePurchaseShopCartItemDto> getSubmitPersonShopCartItems(String mobile, String collaborativePurchaseId);

    /**
     * 添加购物车
     *
     * @param param  购物车参数信息
     * @param mobile 提报人手机号
     */
    void addSubmitPersonShopCartItem(ChangeSubmitPersonShopCartParam param, String mobile);

    /**
     * 根据购物车ids删除协同采购购物车
     *
     * @param basketIds 购物车ids
     */
    void deleteSubmitPersonShopShopCartItemsByBasketIds(List<Long> basketIds);

    /**
     * 获取协同采购单的购物车提报后的商品
     *
     * @param collaborativePurchaseId 协同采购单单号
     * @return List<CollaborativePurchaseShopCartItemDto>
     */
    List<CollaborativePurchaseShopCartItemDto> getShopCartItemsByCollaborativePurchaseId(String collaborativePurchaseId);

    /**
     * 分页获取协同采购单已提报产品
     *
     * @param collaborativePurchaseId 协同采购单id
     * @param status                  状态
     * @return IPage<CollaborativePurchaseShopCartItemDto>
     */
    IPage<CollaborativePurchaseShopCartItemDto> pageShopCartItemsByCollaborativePurchaseId(PageParam page, String collaborativePurchaseId, String status);

    /**
     * 根据协同采购单号和状态查询购物车商品
     *
     * @param collaborativePurchaseId
     * @param status
     * @return
     */
    List<CollaborativePurchaseShopCartItemDto> getShopCartItemsByCollaborativePurchaseIdAndStatus(String collaborativePurchaseId, String status);

    /**
     * 根据店铺组装购车中的商品信息，返回每个店铺中的购物车商品信息
     *
     * @param collaborativePurchaseSubmitShopCartItems 指定的购物项目
     * @return 每个店铺的购物车信息
     */
    List<ShopCartDto> getShopCarts(List<CollaborativePurchaseShopCartItemDto> collaborativePurchaseSubmitShopCartItems);

    /**
     * 根据协同采购id获取
     * @param cpId
     * @return
     */
    List<CPProdInfo> getCPSubmitAndCompletePordInfo(String cpId);
}
